//
//  WPSearchHistoryCell.m
//  wobingwoyi
//
//  Created by WGP on 16/9/6.
//  Copyright © 2016年 WGP. All rights reserved.
//

#import "WPSearchHistoryCell.h"

@interface WPSearchHistoryCell ()

@property(nonatomic,strong)UIImageView *separatorLine;

@end
@implementation WPSearchHistoryCell

-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    if ([super initWithStyle:style reuseIdentifier:reuseIdentifier])
    {
        self.selectionStyle = UITableViewCellSelectionStyleNone;
        [self separatorLine];
    }
    return self;
}

-(UIImageView *)separatorLine
{
    if (_separatorLine == nil)
    {
        _separatorLine = [[UIImageView alloc] init];
        _separatorLine.backgroundColor = GLobalLineColor;
        [self.contentView addSubview:_separatorLine];
        
        [_separatorLine mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.equalTo(self.contentView).offset(15);
            make.right.bottom.equalTo(self.contentView);
            make.height.mas_equalTo(0.5);
        }];
    }
    return _separatorLine;
}

-(void)setIsHideLine:(BOOL)isHideLine
{
    _isHideLine = isHideLine;
    if (isHideLine)
    {
        self.separatorLine.hidden = YES;
    }
    else
    {
        self.separatorLine.hidden = NO;
    }
}
@end
